package com.bedrock.project.inside.mapper;


import com.bedrock.project.inside.entity.ProjectInfo;
import com.bedrock.project.inside.entity.WorkHour;
import com.bedrock.project.inside.entity.WorkHourStat;
import com.bedrock.project.inside.vo.response.WorkHourSumVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 工时填报Mapper接口
 */
public interface WorkHourMapper {

    /**
     * 查询工时填报
     */
    public Map selectWorkHourById(Long workHourId);


    /**
     * 查询工时填报列表
     */
    public List<WorkHour> selectWorkHourList(WorkHour workHour);

    /**
     * 新增工时填报
     */
    public int insertWorkHour(WorkHour workHour);
    /**
     * 新增工时填报
     */
    public int countByProjectId(@Param("projectId") Long  projectId);

    /**
     * 修改工时填报
     */
    public int updateWorkHour(WorkHour workHour);

    /**
     * 删除工时填报
     *
     * @param workHourId 工时填报ID
     * @return 结果
     */
    public int deleteWorkHourById(Long workHourId);

    /**
     * 批量删除工时填报
     *
     * @param workHourIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteWorkHourByIds(@Param("workHourIds") Long[] workHourIds);


    public List<Map> getProjectList();


    List<Map> getWorkhourStage();

    List<Map> getWorkhourUsertype();


    List<Map> findWeekReport();


    List<Map> commanWeekReport();


    List<Map> commanWeekReportByPrincipal(Long principalId);


    List<Map> commanWeekReportBySaleman(Long salemanId);


    List<ProjectInfo> getPrincipalList();


    List<ProjectInfo> getSalemanList();


    List<WorkHourSumVo> sumWorkHour();

    /**
     * 批量新增工时填报
     * @param list 批量工时信息
     */
    public void insertBatchWorkHour(List<WorkHour> list);

    /**
     * 复制上周工时
     * @param userId 用户Id
     * @return 上周工时信息
     */
    public List<WorkHour> copyLstWeekWorkHour(Long userId);

    /**
     * 按照项目和个人维度获取当天工时信息填报信息
     * @return 工时统计信息
     */
    public List<WorkHourStat> selectWorkHourListByDay();

}
